package com.kla.power.controller;


import com.kla.power.util.CollectorUtil;

import java.util.Calendar;

public class Main {

    public static void main ( String[] args ) {
        Calendar calendar = Calendar.getInstance ();
        System.out.println ( calendar.get ( Calendar.MONTH ) + 1 );
        calendar.set ( Calendar.DAY_OF_MONTH, 1 );
        calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
        int lastDayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
        System.out.println("当月最后一天：" + lastDayOfMonth);

    }


    public static String bytesToHexString ( byte[] bytes ) {
        StringBuilder sb = new StringBuilder ();
        for ( int i = 0; i < bytes.length; i++ ) {
            String hex = Integer.toHexString ( 0xFF & bytes[i] );
            if ( hex.length () == 1 ) {
                sb.append ( '0' );
            }
            sb.append ( hex );
        }
        return sb.toString ();
    }

}
